UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+s89/c3hPHzRAG24QoLZqmr4o2ShlNYxuEImFU14ejs='
WHERE
key_id = '22183bd3a348529d4d0f079097059e42c887f8b405ac8a58f4a65ec1d764dcc3'
AND (
token = '+s89/c3hPHzRAG24QoLZqmr4o2ShlNYxuEImFU14ejs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)