UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U8WU8oJJjbO3r2Zc3IgayRISukkof9xOaA/dMcL99jE='
WHERE
key_id = '6afad0353513838f4141302d7528adaac36ea810670c62c1d8156ea0dcddbeb3'
AND (
token = 'U8WU8oJJjbO3r2Zc3IgayRISukkof9xOaA/dMcL99jE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)