UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vQswueixf0x1WIrhd50x9fxi/y02i/0q2D9WZJzfppE='
WHERE
key_id = 'a44561f73acbab74e86a72479c3304e4d81adda87fa565cb6df4acc7a8e414ca'
AND (
token = 'vQswueixf0x1WIrhd50x9fxi/y02i/0q2D9WZJzfppE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)