UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gbQE/XJZWXwiseDpRNRKZG3xInmN1ptEk3kEWr5dK6k='
WHERE
key_id = 'd67a2da4fa8ce006dbf6c1dd6cbb5815927dff6817e6c5ec6406a35cf681db52'
AND (
token = 'gbQE/XJZWXwiseDpRNRKZG3xInmN1ptEk3kEWr5dK6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)