UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZVbSlaTbYjx7FqPMHVUdYO/AH5AkZkczhN+HPadTPkY=' 
WHERE 
  key_id = 'efcb78c0ecd945a0d5674663993933001aa5bb0b3f214ec0364fb627b6ecebdd' 
  AND (
    token = 'ZVbSlaTbYjx7FqPMHVUdYO/AH5AkZkczhN+HPadTPkY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026