UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jyhfu0dXg+DiMjFaloZSZ2XJZV3RQiJOjfew5eCpc54=' 
WHERE 
  key_id = '8bd14916ef35cbf67ae5b4d0d5cde5bb0b640ca17332199649dd309615cb3096' 
  AND (
    token = 'jyhfu0dXg+DiMjFaloZSZ2XJZV3RQiJOjfew5eCpc54=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014