UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vwDF6TzeGjR1l4NxLFLaaGxa93/GNsprd46tiBFX7O0='
WHERE
key_id = '0f3d5d84584a4b0ee756d2e293ab5858c26e234cd6c68be6f7debcb453997143'
AND (
token = 'vwDF6TzeGjR1l4NxLFLaaGxa93/GNsprd46tiBFX7O0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)