UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qPJkd3bFl8zURlpXrYmfO6RTpQwucCEc6sbshQ37bGw=' 
WHERE 
  key_id = '2fd6403ecd060a14f8e7a3b224f511415133a397f9538e01da6232851799bfa2' 
  AND (
    token = 'qPJkd3bFl8zURlpXrYmfO6RTpQwucCEc6sbshQ37bGw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026