UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HdklWLAdo8Q9et5YCuUQdZyVo6NyeXFVrM0CrBJFuCA='
WHERE
key_id = '0edeb3a7ea84341b85431cf5645d1a3ed85a1a5ddb567ec4119595851deac396'
AND (
token = 'HdklWLAdo8Q9et5YCuUQdZyVo6NyeXFVrM0CrBJFuCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)