UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rVsmskNYtG/XmSdmJ2/wq3wtLAHyRvBep8LWgMDLi9g='
WHERE
key_id = 'a7dadb650d3d7ffd9f3065af38bb955b2ea0752a41df365cccf00c873a0f82a3'
AND (
token = 'rVsmskNYtG/XmSdmJ2/wq3wtLAHyRvBep8LWgMDLi9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)