UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'knod5xKR9Fq6HMgbe7XQUDUk+vm11R359X8mzyQYDh8=' 
WHERE 
  key_id = '5b48c7055780a31abd2e285185482e890696c664c02284a7fc3cc06675696c91' 
  AND (
    token = 'knod5xKR9Fq6HMgbe7XQUDUk+vm11R359X8mzyQYDh8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022