UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LZZ9hHw75rS/9LPsmwYm2B4qvPImhyEiVZLtV4qD/m8=' 
WHERE 
  key_id = '4eb8126726ff158a97189c78e2777a3b5d4d4d0077a9783140de9727d1723d8f' 
  AND (
    token = 'LZZ9hHw75rS/9LPsmwYm2B4qvPImhyEiVZLtV4qD/m8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043