UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QZ1RdEzCG8CDHpSa4Mn8LDYS3Jdu5ihAcG4pM0C5n8I=' 
WHERE 
  key_id = '8695802eb94f920ffba663c8ecefa8c4eee1ce14bffae03ab32e9cb861765de1' 
  AND (
    token = 'QZ1RdEzCG8CDHpSa4Mn8LDYS3Jdu5ihAcG4pM0C5n8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069