UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oi9E4gLu44xcIz4kONhmpHt6ZSxAc3+ILQSWTIdL7UI='
WHERE
key_id = 'a5c013767edfc687d421bf5089d79dca44919033a1e61fbb3647ea1d80561c49'
AND (
token = 'oi9E4gLu44xcIz4kONhmpHt6ZSxAc3+ILQSWTIdL7UI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)