UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AUEHvwA6h9tu6lKyONrb2JPiOKBKGhslF4Sad2QmdeU=' 
WHERE 
  key_id = '2d5a1221dbe3fef6e5ef40dcc111fe69916426c68c4e2913f012b0f6d7a5d2a7' 
  AND (
    token = 'AUEHvwA6h9tu6lKyONrb2JPiOKBKGhslF4Sad2QmdeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034