UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AGdnQeQfNp0N4gLH3dYZ/usGnR/Rw2CaWPI0KboZJFo=' 
WHERE 
  key_id = 'cdcc168009e91b3da6576b0dcae4b3782e4aecbef0ad6a1ee121569b701962f2' 
  AND (
    token = 'AGdnQeQfNp0N4gLH3dYZ/usGnR/Rw2CaWPI0KboZJFo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031