UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ylgei6FsevJh1Ly9vcHbjXwe8MMUL2zsgEPXgd3EEVY='
WHERE
key_id = '5e9ff4a6603564b484d665c23b5220c3a849a4bae82e6582af3de11f530db1ea'
AND (
token = 'Ylgei6FsevJh1Ly9vcHbjXwe8MMUL2zsgEPXgd3EEVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)