UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qdf2HoApHJ4C7KzyvQZJIlqwX/S1ALUVytQcHYyjz1o='
WHERE
key_id = '132bcf2a4e60364049027a2dc189dd3184d8854d9e1bd91f561d2291a7043355'
AND (
token = 'qdf2HoApHJ4C7KzyvQZJIlqwX/S1ALUVytQcHYyjz1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)