UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o2If+ylDKC+/Y0NWuNG7RZdwzS5aCuwoHA8sLZks6Rs=' 
WHERE 
  key_id = '1e7d159d5bbdfd20129cc70136a8a31c03a89eb8205f25ee3b4d9127736b4330' 
  AND (
    token = 'o2If+ylDKC+/Y0NWuNG7RZdwzS5aCuwoHA8sLZks6Rs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038