UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hxa9uyPxtlTClQs4mzIe5aUHL4FVk/Omih6TLcY2OzM='
WHERE
key_id = '43138580fd8827380a61f6233a31395d24e293d8fbb252de41f3f06186fdb752'
AND (
token = 'hxa9uyPxtlTClQs4mzIe5aUHL4FVk/Omih6TLcY2OzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)