UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qxoBjuMTyhhpCj3+8c/bzWXQoNDTkCFD1vjAhBa5dX8='
WHERE
key_id = '019059319b204cd68c63f200639abae0db3b9b4b38e3a49afb5729bf883e6929'
AND (
token = 'qxoBjuMTyhhpCj3+8c/bzWXQoNDTkCFD1vjAhBa5dX8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)