UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uJT77osfqSvGu3zQ5bKdb2M6+NbQUF8aOdqJnv1ouCs=' 
WHERE 
  key_id = '718c26638aeb29db7dae7225e9a1812698152c4231c2bbce8fe290cb34ac6644' 
  AND (
    token = 'uJT77osfqSvGu3zQ5bKdb2M6+NbQUF8aOdqJnv1ouCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018