UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZmRL7Ug5v5FZop5+0i0pdHxQgPAXXSjlJniTDanmUR0=' 
WHERE 
  key_id = '733285313a6c707dc4a59793cae2f04d7eeeea62bc668efe2acc7d8611e6c0e3' 
  AND (
    token = 'ZmRL7Ug5v5FZop5+0i0pdHxQgPAXXSjlJniTDanmUR0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033