UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6TK4bqB7CA/8bEJkup4t6wl11vylFaXrMY13edW3Jh4=' 
WHERE 
  key_id = 'bb9f2e909c94cdd00aa08135d4c2a7a8b9153e042b80ab8f0e649fe4afd3805f' 
  AND (
    token = '6TK4bqB7CA/8bEJkup4t6wl11vylFaXrMY13edW3Jh4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054