UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sjvY6GgcxhvBRdIuKR4Ipeu118ZovJg+Mrer3h6deNs=' 
WHERE 
  key_id = '335e26dd6df6bc5a5547535fbe8f9ea770142c32cde11cd1fc0cd4e0e66d08a5' 
  AND (
    token = 'sjvY6GgcxhvBRdIuKR4Ipeu118ZovJg+Mrer3h6deNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023