UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VVj4c7lMHd6lolNEhDcMyxYYcHqtkIqKZCKBFI/mDec='
WHERE
key_id = '0506e3bf4cec0d35cc775d98435383da3e9887397b6a5d1d0f2db419aed86588'
AND (
token = 'VVj4c7lMHd6lolNEhDcMyxYYcHqtkIqKZCKBFI/mDec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)