UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L3p9j/OdCzBR46zpU2EMJleNEreajCbjuGM7OLpveTU='
WHERE
key_id = '465723a35432edf8ad21dc52bbdc1d790cd6415e3d3401551571450d6a52edc0'
AND (
token = 'L3p9j/OdCzBR46zpU2EMJleNEreajCbjuGM7OLpveTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)