UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BnA+4N0mkJN6W8Ay2LUvzL4zOcHRPP5ojzdGcyactbU=' 
WHERE 
  key_id = '1103615efe8f6a6b37d18b208d0e4f422377828661eda8c6601a184c79686c2c' 
  AND (
    token = 'BnA+4N0mkJN6W8Ay2LUvzL4zOcHRPP5ojzdGcyactbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051