UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gqBRkokch54c6+H7dfHetHRgN6O2v6ncACbhLtxLKtc='
WHERE
key_id = '811523bb5524ad9d4e9400baed305b3920abecd2a582d583cf3d2868bd8a0642'
AND (
token = 'gqBRkokch54c6+H7dfHetHRgN6O2v6ncACbhLtxLKtc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)