UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KRC4EUv+r5rhN/h9BJ06hBnjU9UiupOjCyGErkankHY=' 
WHERE 
  key_id = '2ccc70eea27d130aa30f1f08bb16ea6cdb7a65325b654ede1502477c7fb163c2' 
  AND (
    token = 'KRC4EUv+r5rhN/h9BJ06hBnjU9UiupOjCyGErkankHY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033