UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UhnSkP/XrKZZVuqXDJRXHg9CH9h/EfZ+4OVCTduZFlo=' 
WHERE 
  key_id = 'a21914d03da768c726d935f6d79947e47da714459f9ff90e28eb4fa1bfc89ffe' 
  AND (
    token = 'UhnSkP/XrKZZVuqXDJRXHg9CH9h/EfZ+4OVCTduZFlo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035