UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pRLo7MvVA/kZ+oNfQe2HaV/hc5Pns03+bZMdLVwNST8=' 
WHERE 
  key_id = '0c5921cfc97cb40ce5be0b71521614b61a1bef8d16b419d52ecee9766bbe4bab' 
  AND (
    token = 'pRLo7MvVA/kZ+oNfQe2HaV/hc5Pns03+bZMdLVwNST8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039