UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JrB0sEU5jQQ0ul2pdO7AMESzU82RhhKWXvPC0aUZjqQ=' 
WHERE 
  key_id = '19638fe6a36e86c6304abf96a2b3fed55c6205cccca1d269c6e2e881139da366' 
  AND (
    token = 'JrB0sEU5jQQ0ul2pdO7AMESzU82RhhKWXvPC0aUZjqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021